import { ref } from 'vue'
import type { AddressItem } from '@/types/address'
import { defineStore } from 'pinia'

// 定义 Store
export const useAddressStore = defineStore('address', () => {
  // 选中的地址
  const address = ref<AddressItem>()

  // 保存地址
  const setAddress = (val: AddressItem) => {
    address.value = val
  }
  // 记得 return
  return {
    address,
    setAddress,
  }
})
